package com.woniu.service.Impl;

import com.woniu.dao.CreditChannelDao;
import com.woniu.entity.CreditChannel;
import com.woniu.service.CreditChannelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CreditChannelServiceImpl implements CreditChannelService {
    @Autowired
    CreditChannelDao creditChannelDao;

    @Override
    public List<CreditChannel> listChannel(CreditChannel creditChannel) {
        return creditChannelDao.listChannel(creditChannel);
    }

    /**
     * 新增渠道商
     *
     * @param creditChannel
     * @return
     */
    @Override
    public int addChannel(CreditChannel creditChannel) {
        return creditChannelDao.addChannel(creditChannel);
    }

    /**
     * 修改渠道商
     *
     * @param creditChannel
     * @return
     */
    @Override
    public int updateChannel(CreditChannel creditChannel) {
        return creditChannelDao.updateChannel(creditChannel);
    }

    @Override
    public CreditChannel findById(int id) {
        return creditChannelDao.findById(id);
    }

    @Override
    public int updateStatus(int id, String stat) {
        return creditChannelDao.updateStatus(id, stat);
    }
}
